import type { App } from 'vue'

export function withInstall<T>(component: T) {
  const comp = component as any
  comp.install = (app: App) => {
    app.component(comp.name, comp)
  }
  return comp as T & { install: (app: App) => void }
}